set $5 to mutexexists "Local\Master Builder Application"
goto @mutex if equal {$5} "1"
set $4 to registry "SOFTWARE\CadSoft\3DHome" "InstallDir" 2
goto @install if equal {$4} ""
set $5 to registry "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{EA10FC33-3DBC-4268-A90E-1681760FD417}" "VersionMajor" 2
goto @install if not equal {$5} "5"
set $5 to registry "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{EA10FC33-3DBC-4268-A90E-1681760FD417}" "VersionMinor" 2
goto @install if not equal {$5} "1"
set $6 to inifile {%pigdir}"config.ini" "config" "mask"
set $7 to registry "SOFTWARE\CadSoft\3DHome\UIManager" "Mask" 2
goto @install if equal {$7} ""
set $minmask to inifile {%pigdir}"config.ini" "config" "minmask"
goto @oldversion if less {$7} {$minmask}
@checkmaskloop_begin
set $9 to left {$6}
set $6 to right {$6}
set $8 to checkmask {$9} {$7}
goto @checkmaskloop_end if equal {$8} "1"
goto @checkmaskloop_end if equal {$6} ""
goto @checkmaskloop_begin
@checkmaskloop_end
goto @install if not equal {$8} "1"
run {$4}\launcher\launcher.exe
goto @stop
@install
run autorun.exe
goto @stop
@oldversion
message "Uninstall Required" "One of the Broderbund 3D Home Design products was detected on your machine. You must uninstall that product before continuing."